<?php
include 'rfq_check.php';
if (isset($_POST)) {
    include 'rfq_do.php';
    include 'common/database.php';
    include '../business/toolmaking_manager.php';
    include_once '../entity/toolmaking_entity.php';

    $toolmakingEntity   = new ToolmakingEntity;
    $toolmakingMng      = new ToolmakingMng();

    $toolmakingEntity->id           = "-1";
    $toolmakingEntity->rfqId        = $rfqID;
    $toolmakingEntity->quote        = $_POST['rd_quote'];
    $toolmakingEntity->attached     = isset($_POST['chk_attached']) ? true : false;
    $toolmakingEntity->advise       = isset($_POST['chk_advise']) ? true : false;
    $toolmakingEntity->cavities     = $_POST['txt_cavities'];
    $toolmakingEntity->steel        = $_POST['txt_steel'];
    $toolmakingEntity->preferred     = isset($_POST['txt_preferred']) ? true : false;
    $toolmakingEntity->other        = $_POST['txt_other'];
    $toolmakingEntity->information  = $_POST['txt_information'];
    $toolmakingEntity->inTime       = time();
    $toolmakingEntity->inUser       = "-1";

    $toolmakingMng->update($toolmakingEntity);
} else {
    include 'common/smarty.php';
    $tpl->display('toolmaking.html');
}
?>
